<?php
require('db.php');
function check_brand_input($key)
{
	if ($_POST[$key] == '')
	{
		die($key." can't be null");
	}
	echo mb_detect_encoding($_POST[$key], "auto");
	return $_POST[$key];
}
	var_dump( $_POST);
	$product_class 		= check_brand_input('product_class');
	$product_class_des  	= check_brand_input('poduct_class_des');
	$product_brand		= check_brand_input('product_brand');
	$product_brand_des	= check_brand_input('product_brand_des');
	$product_sub_brand	= $_POST['product_sub_brand'];
	$product_sub_brand_des	= $_POST['product_sub_brand_des'];

	//$rs = $db->Execute('select * from SPIDER_PRODUCT_BRAND');
	
	//var_dump($rs->getRows());
	print mb_http_input($product_class_des);
	$newbrand = "INSERT INTO SPIDER_PRODUCT_BRAND (product_class,product_calss_des,product_brand,product_brand_des,product_sub_brand,product_sub_brand_des) VALUES ('".$product_class."','".$product_class_des."','".$product_brand."','".$product_brand_des."','".$product_sub_brand."','".$product_sub_brand_des."')";
	$rs= $db->Execute($newbrand);
	
	if (!$rs){
		var_dump($db);
	}else{
	
	}
?>
